<head>
	<script>
		/*setTimeout(function() 
			{
				$('#flashMessage').fadeOut('slow');
			}, 5000);*/
		
		
	</script>

</head>
<body>
	<center>
		<?php

			if ($eventos)
			{
		?>
		<table>
			<tr>
				<td>
					<center>
						<table style="width: 50%">
							<?php 
									/*echo $this->Form->create('Delete_Sede_Evento',array('url' => array(
																											   'controller' => 'Eventos',
																											   'action' => 'delete_sede_evento'
																										  )
																						)
																);*/
							?>
							<tr>
								<td style="vertical-align: middle; text-align: center">
									<button class="boton_regular" type="button" onclick="seleccionar_todos(true);">Seleccionar Todos</button>
								</td>
								<td style="vertical-align: middle; text-align: center">
									<button class="boton_regular" type="button" onclick="seleccionar_todos(false);">Deseleccionar Todos</button>
								</td>
								
								<td style="vertical-align: middle; text-align: center">
									<button class="boton_regular" onclick="return activar_deactivar_selecionados(false);" type="submit">Eliminar Evento(s)</button>
									<?php 
										/*echo $this->Form->input('Eliminar Evento(s)',array(
																							'type' => 'button',
																							'class' => 'boton_regular',
																							'onclick' => 'return activar_deactivar_selecionados(false);',
																							'label' => array(
																												'style' => array('display: none')
																											)
																						)
																	);*/
									?>
								</td>
							</tr>
						</table>
						<?php	
							echo $this->Session->flash();
						?>
					</center>
				</td>
			</tr>
			<tr>
				<td>
					<fieldset>
						<center>
							
						
							<input id="sede_eventos_seleccionados" type="hidden">
							<table id="tabla_sede_evento">
								<tr>
									<td style="text-align: center"> 
										<b></b>
									</td>
									<td style="text-align: center"> 
										<b>Nombre de Evento</b>
									</td>
									<td style="text-align: center"> 
										<b>Fecha Inicio del Evento</b>
									</td>
									<td style="text-align: center"> 
										<b>Fecha Fin del Evento</b>
									</td>
									<td style="text-align: center"> 
										<b>Sede</b>
									</td>
									<td style="text-align: center"> 
										<b>Detalle</b>
									</td>
									<td style="text-align: center"> 
										<b>Editar</b>
									</td>
									<td style="text-align: center"> 
										<b>Eliminar</b>
									</td>
								</tr>
								<?php 
								foreach ($eventos as $evento) 
						        {
									
								 ?>
								<tr>
									<td style="text-align: center"> 
										<?php 
											
											echo $this->Form->input('check_box',array(
																							'type' => 'checkbox',
																							'id' => $evento['ES']['id'],
																							'class' => 'check_box_sede_eventos',
																							'label' => array(
																												'style' => array('display: none')
																											)
																						)
																	);
										?>
									</td>
									<td style="text-align: center"> 
										<?php echo $evento['E']['nombre_evento']; ?>
									</td>
									<td style="text-align: center"> 
										<?php echo date('d/m/Y',strtotime($evento['ES']['fecha_inicio_evento'])); ?>
									</td>
									<td style="text-align: center"> 
										<?php echo date('d/m/Y',strtotime($evento['ES']['fecha_fin_evento'])); ?>
									</td>
									<td style="text-align: center"> 
										<?php echo $evento['S']['nombre_sede']; ?>
									</td>
									<td style="text-align: center"> 
										<?php
												echo $this->Html->image('detail.png', array(
																							'alt' => 'CakePHP',
																							'onclick' => 'showDetalleEvento('.$evento['ES']['id'].')',
																							/*'url' => array('controller' => 'eventos',
																										   'action' => 'detalle_sede_evento',
																										   $evento['ES']['id']
																										  ),*/
																							'style' => array (
																												'cursor: pointer'
																											 )
																						  )
																		);
											?>
									</td>
									<td style="text-align: center"> 
										<?php
												echo $this->Html->image('edit1.png', array(
																							'alt' => 'CakePHP',
																							'onclick' => 'showEditEvento('.$evento['ES']['id'].')',
																							/*'url' => array('controller' => 'eventos',
																										   'action' => 'edit_sede_eventos',
																										   $evento['ES']['id']
																										  ),*/
																							'style' => array (
																												'cursor: pointer'
																											 )
																						  )
																		);
											?>
									</td>
									<td style="text-align: center"> 
										<?php /*echo $this->Html->link($this->Html->image('delete.png', array(
																												'alt' => 'CakePHP',
																												'style' => array ('cursor: pointer')
																						  					)
																			       					 ),
																					 array(
																					 	
																					 	   'controller' => 'eventos',
																						   'action' => 'delete_sede_evento',
																						   $evento['ES']['id'],1
																						   
																						   
																						  ),
																					 array(
																					 
																                            'escape' => false,
																                            'confirm' => 'Estas seguro Eliminar el Evento '.$evento['E']['nombre_evento'].' ?'
																                          
																						  )
													 
																					      
																				  );*/
									  ?>
									  <a href="#" onclick="activar_deactivar_button(<?php echo $evento['ES']['id']; ?>);">
											<img src="/BackEndRecursosHumanos/img/delete.png" alt="CakePHP" style="cursor: pointer">
										</a>
									</td>
									
								</tr>
								<?php 
								}?>
							</table>
						</center>
					</fieldset>
				</td>
			</tr>
		</table>
		
		<?php
		}
		else
		{
		?>
			<fieldset>
				<center>
					<?php	
							echo $this->Session->flash();
						?>
					<h3 style="color: black">No se encontro ningun resultado </h3>
					<br />
				</center>
			</fieldset>
			
		<?php
		}
		?>
	</center>
</body>
